if __name__ == "__main__":
    from utils import get_env
    from server import app, print_startup_banner, print_routes, upsert_rule_path


    host = get_env("server.host")
    port = get_env("server.port")
    mode = get_env("development")
    dev_mode = mode == "true"
    if dev_mode:
        print_startup_banner(host, port)
        # print(print_routes())
    
    upsert_rule_path()

    app.run(host=str(host), port=int(port), debug=dev_mode)
